/* Layout */
import Layout from "@/views/layout/Layout";
/*  ------------- 复享光谱仪  ------------- */
const repeatedTest = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/repeated/aTest")),
    "ReplaySpectrometer"
  );
const repeatedHistory = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/repeated/aHistory")),
    "ReplaySpectrometer"
  );
const repeatedDetail = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/repeated/aDetail")),
    "ReplaySpectrometer"
  );
/*  ------------- 常辉蔗糖水  ------------- */
const spectrometerTest = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/changHui-spectrometer/aTest")),
    "ChanghuiSucroseWater"
  );
const spectrometerHistory = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/changHui-spectrometer/aHistory")),
    "ChanghuiSucroseWater"
  );
const spectrometerDetail = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/changHui-spectrometer/aDetail")),
    "ChanghuiSucroseWater"
  );
/*  ------------- 非洲猪瘟抗体检测  ------------- */
const swineTest = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/swine-fever/newATest")),
    "AfricanSwineFever"
  );
const swineHistory = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/swine-fever/newAHistory")),
    "AfricanSwineFever"
  );
const swineDetail = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/swine-fever/newADetail")),
    "AfricanSwineFever"
  );

/*  ------------- 结合解离测试  ------------- */
const bondTest = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/bond-dissociation/aTest")),
    "BindingDissociation"
  );
const bondHistory = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/bond-dissociation/aHistory")),
    "BindingDissociation"
  );
const bondDetail = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/bond-dissociation/aDetail")),
    "BindingDissociation"
  );
/*  ------------- 病毒检测  ------------- */
const vTest = (r) =>
  require.ensure([], () => r(require("@/views/virus/vTest")), "virus");
// const vTest2 = (r) =>
//   require.ensure([], () => r(require("@/views/virus/vTest/vTest")), "vTest2");
const vHistory = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/virus/vHistory")),
    "virus"
  );
const vDetail = (r) =>
  require.ensure([], () => r(require("@/views/virus/vDetail")), "virus");
/*  ------------- 抗体检测  ------------- */
const newATest = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/antibodyNew/newATest")),
    "AntibodyDetection"
  );
const newAHistory = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/antibodyNew/newAHistory")),
    "AntibodyDetection"
  );
const newADetail = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/antibodyNew/newADetail")),
    "AntibodyDetection"
  );
/*  ------------- 如海光谱仪  ------------- */
const bTest = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/nanoSpr/aTest")),
    "RuhaiSpectrometer"
  );
const bHistory = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/nanoSpr/aHistory")),
    "RuhaiSpectrometer"
  );
const bDetail = (r) =>
  require.ensure(
    [],
    () => r(require("@/views/nanoSpr/aDetail")),
    "RuhaiSpectrometer"
  );
const routerList = [
  // 如海光谱仪
  {
    path: "/nanoSpr",
    component: Layout,
    sort: 7,
    alwaysShow: true,
    name: "nanoSpr",
    meta: {
      title: "page.nanoSPR",
      icon: "pinzhijiance",
    },
    children: [
      {
        path: "/bntibodyCd",
        component: bTest,
        name: "bntibodyCd",
        meta: {
          title: "page.upload",
        },
      },
      {
        path: "/bHistory",
        component: bHistory,
        name: "bHistory",
        meta: {
          title: "page.history",
        },
      },
      {
        path: "/bDetail",
        component: bDetail,
        name: "bDetail",
        hidden: true,
        meta: {
          title: "page.detial",
        },
      },
    ],
  },
  // 复享光谱仪
  {
    path: "/repeated",
    component: Layout,
    sort: 8,
    alwaysShow: true,
    name: "repeated",
    meta: {
      title: "page.repeated",
      icon: "zhongxinjiance",
    },
    children: [
      {
        path: "/repeatedBodyCd",
        component: repeatedTest,
        name: "repeatedBodyCd",
        meta: {
          title: "page.upload",
        },
      },
      {
        path: "/repeatedHistory",
        component: repeatedHistory,
        name: "repeatedHistory",
        meta: {
          title: "page.history",
        },
      },
      {
        path: "/repeatedDetail",
        component: repeatedDetail,
        name: "repeatedDetail",
        hidden: true,
        meta: {
          title: "page.detial",
        },
      },
    ],
  },
  // 结合解离测试
  {
    path: "/bondDissociation",
    component: Layout,
    sort: 9,
    name: "BondDissociation",
    meta: {
      title: "page.bondDissociation",
      icon: "jiehejieli",
    },
    children: [
      {
        path: "/bondTest",
        component: bondTest,
        name: "bondTest",
        meta: {
          title: "page.upload",
        },
      },
      {
        path: "/bondHistory",
        component: bondHistory,
        name: "bondHistory",
        meta: {
          title: "page.history",
        },
      },
      {
        path: "/bondDetail",
        component: bondDetail,
        name: "bondDetail",
        hidden: true,
        meta: {
          title: "page.detial",
        },
      },
    ],
  },
  // 常辉蔗糖水
  {
    path: "/spectrometer",
    component: Layout,
    sort: 10,
    name: "spectrometer",
    meta: {
      title: "page.spectrometer",
      icon: "setting",
    },
    children: [
      {
        path: "/spectrometerTest",
        component: spectrometerTest,
        name: "spectrometerTest",
        meta: {
          title: "page.upload",
        },
      },
      {
        path: "/spectrometerHistory",
        component: spectrometerHistory,
        name: "spectrometerHistory",
        meta: {
          title: "page.history",
        },
      },
      {
        path: "/spectrometerDetail",
        component: spectrometerDetail,
        name: "spectrometerDetail",
        hidden: true,
        meta: {
          title: "page.detial",
        },
      },
    ],
  },
  // 非洲猪瘟抗体检测
  {
    path: "/swineFever",
    component: Layout,
    name: "SwineFever",
    sort: 5,
    meta: {
      title: "page.swine",
      icon: "swine",
    },
    children: [
      {
        path: "/swineFeverTest",
        component: swineTest,
        name: "SwineFeverTest",
        meta: {
          title: "page.upload",
        },
      },
      {
        path: "/swineFeverHistory",
        component: swineHistory,
        name: "SwineFeverHistory",
        meta: {
          title: "page.history",
        },
      },
      {
        path: "/swineFeverDetail",
        component: swineDetail,
        name: "SwineFeverDetail",
        hidden: true,
        meta: {
          title: "page.detial",
        },
      },
    ],
  },
  // 病毒检测
  {
    path: "/",
    component: Layout,
    alwaysShow: true,
    sort: 1,
    redirect: "/virus",
    name: "virusDetection",
    meta: {
      title: "page.virus",
      icon: "virus",
    },
    children: [
      // {
      //   path: "/virusCd2",
      //   component: vTest2,
      //   name: "virusCd2",
      //   meta: {
      //     title: "上传多文件",
      //   },
      // },
      {
        path: "/virus",
        component: vTest,
        name: "virusCd",
        meta: {
          title: "page.upload",
        },
      },
      {
        path: "/vHistory",
        component: vHistory,
        name: "vHistory",
        meta: {
          title: "page.history",
        },
      },
      {
        path: "/vDetail",
        component: vDetail,
        hidden: true,
        name: "vDetail",
        meta: {
          title: "page.detial",
        },
      },
    ],
  },
  // 抗体检测
  {
    path: "/newAbody",
    component: Layout,
    name: "newAbody",
    sort: 2,
    meta: {
      title: "page.newAbody",
      icon: "antibody",
    },
    children: [
      {
        path: "/newATest",
        component: newATest,
        name: "newATest",
        meta: {
          title: "page.upload",
        },
      },
      {
        path: "/newAHistory",
        component: newAHistory,
        name: "newAHistory",
        meta: {
          title: "page.history",
        },
      },
      {
        path: "/newADetail",
        component: newADetail,
        name: "newADetail",
        hidden: true,
        meta: {
          title: "page.detial",
        },
      },
    ],
  },
];

export default routerList;
